<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改评分模板')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-template-edit" th:object="${gradeTemplate}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">地区：</label>
                <div class="col-sm-8">
                    <select name="city" class="form-control m-b" th:with="type=${@dict.getType('b_city')}" disabled required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}"  th:field="*{city}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">模板名称：</label>
                <div class="col-sm-8">
                    <input name="templateName" th:field="*{templateName}" class="form-control" type="text" disabled  required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">周期类型：</label>
                <div class="col-sm-8">
                    <select name="periodType" class="form-control m-b" th:with="type=${@dict.getType('b_period_type')}" disabled  required>
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{periodType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">总分：</label>
                <div class="col-sm-8">
                    <input name="totalScore" th:field="*{totalScore}" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <label class="toggle-switch switch-solid">
                        <input type="checkbox" id="status" th:attr ="checked=${gradeTemplate.status=='1'?false:true}">
                        <span></span>
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: ztree-js" />
    <script type="text/javascript">
	    $(function() {
			var url = ctx + "system/menu/roleMenuTreeData";
			var options = {
				id: "menuTrees",
		        url: url,
		        check: { enable: true },
		        expandLevel: 0
		    };
			$.tree.init(options);
		});
        var prefix = ctx + "system/template";
        $("#form-template-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-template-edit').serialize());
            }
        }
    </script>
</body>
</html>